package com.example.demo05.util;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class TurnJson {

    public static void JsonWrite(HttpServletResponse httpServletResponse,JsonResult result) throws IOException {
        httpServletResponse.setContentType("text/json;Charset=utf-8");
        httpServletResponse.getWriter().write(new ObjectMapper().writeValueAsString(result));
    }
}
